package com.sz.ac.handler;

import javax.annotation.PostConstruct;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sz.ac.interfs.IAcGrpService;

/**
 * Created by liyang on 2017/6/14.
 */
@Component
public class StatisticsJob implements Job
{
	private Logger logger = LoggerFactory.getLogger(StatisticsJob.class);
    @Autowired
    private IAcGrpService grpService;
    
    private static StatisticsJob job;
    
    public void execute(JobExecutionContext context) throws JobExecutionException
    {
    	logger.info("****************start PayNotifyJob*******");
    	try
    	{
    		job.grpService.statistic();
    	}
    	catch(Exception e)
    	{
    		logger.error("========{}",e);
    	}
    	
    	
    	logger.info("****************end PayNotifyJob*******");
    }
    
    @PostConstruct
    public void init()
    {
    	job = this;
    }

}
